﻿using System;
using System.Collections.Generic;
using System.Text;

namespace UpYun.Storage.Model
{
    using Newtonsoft.Json;

    /// <summary>
    /// 视频转码结果
    /// </summary>
    public class VideoTranscodingResultModel
    {
        /// <summary>
        /// 任务状态
        /// Key为转码任务id
        /// Value为转码结果
        /// </summary>
        [JsonProperty(propertyName: "tasks")]
        public Dictionary<string, VideoTranscodingTaskResultModel> Tasks { get; set; }
    }

    /// <summary>
    /// 视频转码任务结果
    /// </summary>
    public class VideoTranscodingTaskResultModel
    {
        /// <summary>
        /// 空间名称
        /// </summary>
        [JsonProperty(propertyName: "bucket_name")]
        public string BucketName { get; set; }

        /// <summary>
        /// 任务ID
        /// </summary>
        [JsonProperty(propertyName: "task_id")]
        public string TaskId { get; set; }

        /// <summary>
        /// 状态码
        /// 200 表示成功处理
        /// </summary>
        [JsonProperty(propertyName: "status_code")]
        public int StatusCode { get; set; }

        /// <summary>
        /// 视频参数
        /// </summary>
        [JsonProperty(propertyName: "options")]
        public Dictionary<string, object> Options { get; set; }

        /// <summary>
        /// 输出文件保存路径
        /// </summary>
        [JsonProperty(propertyName: "path")]
        public string[] Path { get; set; }

        /// <summary>
        /// 媒体文件
        /// 转码文件,成功时是转码["xxxxx"]，失败时为{}
        /// </summary>
        [JsonProperty(propertyName: "media_uris")]
        public object MediaUris { get; set; }

        /// <summary>
        /// 
        /// </summary>
        [JsonProperty(propertyName: "chan")]
        public string[] Chan { get; set; }

        /// <summary>
        /// 回调通知的签名，回调签名（旧）的参数
        /// </summary>
        [JsonProperty(propertyName: "signature")]
        public string Signature { get; set; }

        /// <summary>
        /// 
        /// </summary>
        [JsonProperty(propertyName: "uploads")]
        public string[] Uploads { get; set; }

        /// <summary>
        /// 服务端发送回调时的时间戳，回调签名（旧）的参数
        /// </summary>
        [JsonProperty(propertyName: "timestamp")]
        public int Timestamp { get; set; }

        /// <summary>
        /// 信息
        /// </summary>
        [JsonProperty(propertyName: "info")]
        public VideoTranscodingInfoModel Info { get; set; }

        /// <summary>
        /// 处理结果描述
        /// </summary>
        [JsonProperty(propertyName: "description")]
        public string Description { get; set; }
    }

    /// <summary>
    /// 视频转码信息
    /// </summary>
    public class VideoTranscodingInfoModel
    {
        /// <summary>
        /// 文件信息
        /// </summary>
        [JsonProperty(propertyName: "format")]
        public Dictionary<string, object> Format { get; set; }

        /// <summary>
        /// 流信息
        /// </summary>
        [JsonProperty(propertyName: "streams")]
        public Dictionary<string, object>[] Streams { get; set; }
    }
}
